package com.yf.zzmusic.pojo.entity;

import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.time.ZoneOffset;

import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * 关注歌手表
 * </p>
 *
 * @author
 * @since 2024-03-13
 */
@Getter
@Setter
@TableName("follow_singer")
public class FollowSinger implements Serializable {

  private static final long serialVersionUID = 1L;

  /**
   * 关注歌手表唯一id
   */
  private Integer followSingerId;

  /**
   * 用户id
   */
  @NotNull(message = "用户id不可为空")
  private Integer userId;

  /**
   * 歌手id
   */
  @NotNull(message = "歌手id不可为空")
  private Integer singerId;

  /**
   * 关注时间
   */
  private LocalDateTime createTime;

  public Long getCreateTime() {
    if (createTime != null) {
      long timestamp = createTime.toInstant(ZoneOffset.of("+8")).toEpochMilli();
      return timestamp;
    } else {
      return null;
    }
  }

  public void setCreateTime(LocalDateTime createTime) {
    this.createTime = createTime;
  }
}
